package pl.prv.polanie.client.panels;

import pl.prv.polanie.client.filemanager.Directory;
import pl.prv.polanie.client.filemanager.File;

import com.google.gwt.user.client.ui.Composite;

public class SemesterSelectionTreeWidget extends Composite {

	public SemesterSelectionTreeWidget() {
		
		Directory dir = new Directory();
		dir.setDirName("Wybierz semestr");

		
		for (int i = 0; i < 3; i++) {
			Directory d = new Directory();
			d.setDirName("" + (2006 + i) );
			dir.addChild(d);
			
			Directory dWinter = new Directory();
			dWinter.setDirName("zimowy");
			
			Directory dSummer = new Directory();
			dSummer.setDirName("letni");
			
			d.addChild(dWinter);
			d.addChild(dSummer);
			
			
			addSemesterTypesToTree(dWinter);
			addSemesterTypesToTree(dSummer);
		}
		
		initWidget(dir);
	}
	
	private void addSemesterTypesToTree(Directory dir) {
		File fDaily = new File("", "dzienne/wieczorowe");
		File fExtrenistic = new File("", "zaoczne");

		dir.addChild(fDaily);
		dir.addChild(fExtrenistic);
	}
}
